package com.krlin.word.word.utils;

import lombok.Data;

/**
 * @author krlin
 */
@Data
public class CodeMsg {

    private int code;
    private String msg;

    /**
     * 构造函数私有化即单例模式
     * @param code 状态码
     * @param msg 状态信息
     */
    private CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    /** 处理成功 */
    public static CodeMsg SUCCESS = new CodeMsg(0, "success");
    /** 非法数据 */
    public static CodeMsg DATA_ERROR = new CodeMsg(-1, "单词集合为空");
    /** 验证码数据为空 */
    public static CodeMsg CAPTCHA_EMPTY = new CodeMsg(-2, "验证码不能为空");
    /** 实体类验证错误 */
    public static CodeMsg VALIDATE_ENTITY_ERROR = new CodeMsg(-3, "");
    /** Session会话失效 */
    public static CodeMsg SESSION_EXPIRED = new CodeMsg(-4, "会话已失效，请刷新页面重试");
    /** 验证码错误 */
    public static CodeMsg CAPTCHA_ERROR = new CodeMsg(-5, "验证码错误");


    /** 后台管理用户名为空 */
    public static CodeMsg ADMIN_USERNAME_EMPTY = new CodeMsg(-2000, "用户名不能为空");
    /** 后台管理密码为空 */
    public static CodeMsg ADMIN_PASSWORD_EMPTY = new CodeMsg(-2001, "用户密码不能为空");


    /** 登录类错误码 */
    public static CodeMsg ADMIN_USERNAME_NOT_EXIST = new CodeMsg(-3000, "该用户名不存在");
    /** 密码错误 */
    public static CodeMsg ADMIN_PASSWORD_ERROR = new CodeMsg(-3000, "密码错误");
}
